<%@ page import="org.springside.core.Constants,cn.firstsoft.modules.portlet.PortletNewConstants,org.springside.modules.security.domain.UserSession"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<fmt:message key="news_prtal_label1" var="news_prtal_label1"/>
<ff:boxportlet header="${news_prtal_label1}">
<%-- PT046298 xiaofei_zhang 20110224 在集成OA系统中进入办公首页，点击图片新闻中的图片，办公管理、流程中心等页签会自动隐藏 ,在没有使用 iframe 的情况下，屏蔽下面所有 target="_parent"
	设置一个变量ISIFRAME，等要用 iframe 时,将值改成 1
--%>
<c:set var="ISIFRAME" value="0"></c:set> 
<c:set var="count" value="${param.rowCount == null || param.rowCount <= 0 ? 5 : param.rowCount }" />
<!-- 新闻图片和新闻 -->
<c:if test="${fn:length(newssYes)>=5}">
	  <c:set var="newsLength" value="5"></c:set>
	</c:if>
	<c:if test="${fn:length(newssYes)==0}">
	  <c:set var="newsLength" value="0"></c:set>
	</c:if>
	<c:if test="${fn:length(newssYes)>0 && fn:length(newssYes)<5}">
	  <c:set var="newsLength" value="${fn:length(newssYes)}"></c:set>
	</c:if>
<body>
<table width="100%" border="0"  cellpadding="0" cellspacing="0" style="background-color: #fff;">
<tr>
<td align="left" valign="top" style="padding:5 0 0 0">	
<div class="center" style="background:url() no-repeat">
	<div class="left">
		<div id="hotImg">
				<style type="text/css">
				  .bigon{background:url(../../themes/${sessionScope.loginUser.theme}/images/newsb-02.gif);color:#FFF; line-height:18px;}
				  .bigoff{background:url(../../themes/${sessionScope.loginUser.theme}/images/newsb-03.gif);color:#000; line-height:18px;}
				  a.bla{color:#000;font-size:12px; text-decoration:none}
				  a.bla:hover{color:#F00;font-size:12px; text-decoration:underline} </style>
   <table border="0" align="left" cellpadding="0" cellspacing="0">
	       <tr>
	        <td height="115" align="left">
			 <div id="fc" style="width:163px;height:110px;filter:progid:DXImageTransform.Microsoft.Fade ( duration=0.5,overlap=1.0 );">
				<c:forEach items="${newssYes}" var="news" varStatus="newsIndex" end="4">
				<%//PT047848 R110321-152 xiaofei_zhang OA6.0新闻中心中发布的图片，在首页的图片新闻中显示时应按比例缩放 ,用背景图片的方法 最简洁 start%>
					  <c:if test="${newsIndex.index==0}">
							<div style="display:block;">
							<a href="<c:url value="/modules/news/news.do?method=show&cid=${news.newsCatalogy.id}&id=${news.id}" />" target=${tab.openMethod==null?'_self':tab.openMethod} >
							
							<div style="display:block;width:163px;height:115px;cursor:hand;
							background:url(<c:url value="/modules/news/news.do?method=showPicture&main=&newsId=${news.id}&pictureName=${news.newsImgName}" />) center no-repeat
							"
							onMouseOver="clearAuto(document.getElementById('pictureTable'),'${newsLength}');" onMouseOut="setAuto()"
							>	
							</div>						
							<!--  
							<img src="<c:url value="/modules/news/news.do?method=showPicture&main=&newsId=${news.id}&pictureName=${news.newsImgName}" />" width="230" height="106" border="0"
							onMouseOver="clearAuto(document.getElementById('pictureTable'),'${newsLength}');" onMouseOut="setAuto()" />
							-->
							
							</a></div>
					  </c:if>
					  
					 <c:if test="${newsIndex.index!=0}">
							<div style="display:none;">
							<a href="<c:url value="/modules/news/news.do?method=show&cid=${news.newsCatalogy.id}&id=${news.id}" />" target=${tab.openMethod==null?'_self':tab.openMethod} >
							
							<div style="display:block;width:1630px;height:110px;cursor:hand;
							background:url(<c:url value="/modules/news/news.do?method=showPicture&main=&newsId=${news.id}&pictureName=${news.newsImgName}" />) center no-repeat
							"
							onMouseOver="clearAuto(document.getElementById('pictureTable'),'${newsLength}');" onMouseOut="setAuto()"
							>	
							</div>
							<!-- 
							<img src="<c:url value="/modules/news/news.do?method=showPicture&main=&newsId=${news.id}&pictureName=${news.newsImgName}" />" width="230" height="106" border="0"
							onMouseOver="clearAuto(document.getElementById('pictureTable'),'${newsLength}');" onMouseOut="setAuto()" />
							 -->
							</a></div>
					  </c:if>
					<%//PT047848 R110321-152 xiaofei_zhang OA6.0新闻中心中发布的图片，在首页的图片新闻中显示时应按比例缩放 ,用背景图片的方法 最简洁  end %>
				</c:forEach>
				<c:if test="${fn:length(newssYes)==0}">
					   <div style="display:block;">
<!--						 <a href="#" target=${tab.openMethod==null?'_self':tab.openMethod} >-->
						 <img src="<c:url value="../../themes/${sessionScope.loginUser.theme}/images/noimg.jpg" />" width="163" height="115" border="0"/>
<!--						 </a>-->
					   </div>
				</c:if>
			 </div>
			</td>
	       </tr>

 			<c:if test="${fn:length(newssYes)>0}">
 			<input type="hidden" id="newsCountHid" value="${newsLength}">
            <tr>
              <td height="19" background="../../themes/${sessionScope.loginUser.theme}/images/newsb-01.gif">
			    <table width="173" height="19" border="0" align="center" cellpadding="0" cellspacing="0" >
                  <tr>
                    <td width="173" align="center"  onmouseover="clearAuto(document.getElementById('pictureTable'),'${newsLength}');" onMouseOut="setAuto()">
						  <div id="con">
					         <c:forEach items="${newssYes}" var="news" varStatus="newsIndex" end="4">
					                <c:if test="${newsIndex.index==0}">
					                    <div style="display:block;">
					                          <a href="<c:url value="/modules/news/news.do?method=show&cid=${news.newsCatalogy.id}&id=${news.id}" />" target=${tab.openMethod==null?'_self':tab.openMethod} class="bla">
					                                  <c:choose> <c:when test="${fn:length(news.title) >8}">
					                                     ${fn:substring(news.title, 0, 8)} .... </c:when> <c:otherwise> ${news.title}
					                                  </c:otherwise> </c:choose>

					                         </a>
					                	</div>
						          </c:if>
								    <c:if test="${newsIndex.index!=0}">
								           <div style="display:none;">
								                   <a href="<c:url value="/modules/news/news.do?method=show&cid=${news.newsCatalogy.id}&id=${news.id}" />" target=${tab.openMethod==null?'_self':tab.openMethod} class="bla">
								                     <c:choose> <c:when test="${fn:length(news.title) >8}">
								                        ${fn:substring(news.title, 0, 8)} .... </c:when> <c:otherwise> ${news.title}
								                          </c:otherwise> </c:choose>
								                   </a>
								           </div>
						        </c:if>
							</c:forEach>
						 </div>
					</td>
                    <td width="57">
					    <table border="0" align="center" cellpadding="0" cellspacing="3" class="lhn" id="pictureTable">
	                        <tr>
		                        <c:forEach items="${newssYes}" var="news" varStatus="newsIndex" end="4">
		  								<c:if test="${newsIndex.index==0}">
												<div style="display:block;">
												     <td width="14" height="18" align="center" class="bigon" onclick="Mea(${newsIndex.index});" onmouseover="clearAuto(document.getElementById('pictureTable'),'${newsLength}');" onmouseout="setAuto()" style="cursor:pointer;">${newsIndex.index+1}</td>
												</div>
										</c:if>
		    							<c:if test="${newsIndex.index!=0}">
											<div style="display:none;">
											 <td width="14" align="center" class="bigoff" onclick="Mea(${newsIndex.index});" onmouseover="clearAuto(document.getElementById('pictureTable'),'${newsLength}');" onmouseout="setAuto()" style="cursor:pointer;">${newsIndex.index+1}</td>
											</div>
										</c:if>
								</c:forEach>
	                        </tr>
                        </table>
					</td>
                  </tr>
              </table>
           </td>
        </tr>
 		</c:if>
   </table>
   
    	</div>
    </div>
</div> 
</td>
<!-- //图片新闻标题 -->
      <td align="left" valign="top" style="padding:0 0 0 0px">
      <table width="100%" class="tbl_news" border="0"  cellpadding="0" cellspacing="0">
       <!-- 文字新闻 -->
      <c:forEach var="news" items="${newssNo}" end="4">
        <tr>
            <td><img border=0 align="absmiddle" src="../../themes/portlet/listLogo/${tab.logo}"/>
            <a href="<c:url value="/modules/news/news.do?method=show&cid=${news.newsCatalogy.id}&id=${news.id}" />"
            	title="${news.title}" target=${tab.openMethod==null?'_self':tab.openMethod}> <c:choose> <c:when test="${fn:length(news.title) >10}">
            ${fn:substring(news.title, 0,10)} .... </c:when> <c:otherwise> ${news.title}
            </c:otherwise> </c:choose> </a> <font color="#999999">(<fmt:formatDate value="${news.createdate}" pattern="MM-dd HH:mm"/>)</font></td>
        </tr>
        </c:forEach>
	       	<c:if test="${fn:length(newssNo) < count }">
		        <c:forEach begin="${fn:length(newssNo)}" end="${count-1}">
		        	<tr><td>&nbsp;</td></tr>
		        </c:forEach>
      		</c:if>
        </table>
   		<table width="100%" height="10" style="margin-bottom:2px" border="0">
        <tr>
          
          <td align="right">
          	<c:if test="${tab.hasMore==1}">
          		<%
          			UserSession userSession = (UserSession) session.getAttribute("loginUser");
          			String color = PortletNewConstants.getMoreColor(userSession.getThemePath());
          		%>
	          <a href="#" style="color:<%=color %>" onClick='mainJump("/modules/news/news.do?method=showIndex","<%=Constants.USER_THEME_FRAME %>")'
	         	title="<fmt:message key="common_more" />">
	         	
	         	<img src='../../themes/mskin/skin/${sessionScope.loginUser.themePath}/images/portal/more.png' border='0' width='12' height='12' align='middle'/>
	         	<fmt:message key="common_more" /></a>
	         
	         </c:if>
         	</td>
        </tr>
     	</table>
   </td>
   </tr>
 </table>
</body>
</ff:boxportlet>